<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.ld.com/shield/tags" prefix="shield"%>
<%@ taglib uri="http://www.ld.com/system/tags" prefix="system"%>
<!-- 内容主体区域 -->
<%-- 权限判断 --%>
<shield:permssion type="button">
<div class="show-info" >
	<form action="${ctxPathA }/setDSSource" method="post" autocomplete="off" class="layui-form">
		<shield:token/>
		<table class="tab-show"  data-notitle="true" >
			<colgroup>
				<col width="">
				<col width="350">
			</colgroup>
			<tbody>
				<tr>
					<th class="t_r"><label>介绍：</label></th>
					<td>
						<div class="ds_desp_title tips">每日一句</div>
						<div class="ds_desp_content">每天上网、读书、听音乐可能都会看到、听到让我们感动不已或者感同身受的句子，我们要做的就是收集这些内容。<br>我们不生产句子，我们只是互联网的搬运工。</div>
						<div class="ds_desp_link"></div>
					</td>
				</tr>
				<tr>
					<th class="t_r"><label>数据来源：</label></th>
					<td  data-notitle="true" >
<c:forEach var="item" items="${model.items }">
						<div class="block-i" style="width: 77px;"><input type="checkbox" name="key" class="check" value="${item.key }" ${item.enable?'checked':'' }/><span data-desp="${item.description }" data-link="${item.linkUrl }"  class="daliysentencedesp" style="cursor: pointer;" title="点击查看介绍">${item.name }</span></div>
</c:forEach>
						<div class="red">请勾选你感兴趣的数据来源，可点击名称查看简介</div>
					</td>
				</tr>
				<tr>
					<th class="t_r"><label>是否启用：</label></th>
					<td>
						<!-- checkboxSwitch切换值，选中则赋值为value（没有默认为1）不选中为0 -->
						<div class="block-i"><input type="checkbox" name="enable" class="check checkboxSwitch" value="1" ${model.enable?'checked':'' }/>启用</div>
					</td>
				</tr>
			</tbody>
		</table>
		<div class="taCenter">
			<input class="button" type="submit" value="提交"/>
	    	<input class="button default" type="reset" value="重置"/>
	    </div>
		
	</form>
</div>
<script>
(function(){
	$(".daliysentencedesp").click(function(){
		var $this = $(this);
		var tableE = $this.closest("table");
		tableE.find(".ds_desp_title").html($this.text());
		tableE.find(".ds_desp_content").html($this.data("desp"));
		tableE.find(".ds_desp_link").html('网址：<a href="'+$this.data("link")+'" target="_blank">'+$this.data("link")+'</a>');
	});
})();
</script>
</shield:permssion>
